#include <iostream>
#define random(x) rand() % (x)  //函数random(x)产生0-x内的随机数
using namespace std;

int main()
{
    int arr[5][10];
    int average[5]; //储存每个学生的平均分
    int course[10] = {0};   //储存每门课程的不及格人数
    for (int i = 0; i < 5; i++)
    {
        int eva = 0;
        for (int j = 0; j < 10; j++)
        {
            arr[i][j] = random(100);
            if(j==9){
                cout << arr[i][j] ;
            }
            else{
                cout << arr[i][j] << ",";
            }
            eva += arr[i][j];   //eva储存每个学生的总分数
            if (arr[i][j] < 60)
            {
                course[j]++;
            }
        }
        average[i] = eva / 10;
        cout << endl;
    }
    for (int i = 0; i < 5; i++)
    {
        cout << average[i] << endl;
    }
    for (int i = 0; i < 10; i++)
    {
        if(i ==9)
        {
            cout<<course[i];
        }
        else
        {
            cout << course[i] << ",";
        }
        
    }
    return 0;
}